package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

@TableName("t_orderDetail")
public class OrderDetailBean {
    /**订单明细编号*/
    @TableId(value = "pk_orderDetailId",type = IdType.AUTO)
    private Integer id;
    /**订单id*/
    @TableField("fk_orderId")
    private Integer orderId;
    /**产品对象*/
    @TableField(exist = false)
    private ProductBean product;
    /**购买产品数量*/
    @TableField("od_count")
    private Integer count;

    public OrderDetailBean() {
    }

    public OrderDetailBean(Integer orderId, int productId, Integer count) {
        this.orderId = orderId;
        this.product = new ProductBean();
        this.product.setId(productId);
        this.count = count;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public ProductBean getProduct() {
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return "OrderDetailBean{" +
                "id=" + id +
                ", orderId=" + orderId +
                ", product=" + product +
                ", count=" + count +
                "}\n";
    }
}
